﻿@model Apps.Models.PUB.PUB_DEVICEModel
@using Apps.Web.Core;
@using Apps.Common;
@using Apps.Models.PUB;
@using Apps.Web;
@using Apps.Locale;
@using Apps.Models.Sys;
@{
    ViewBag.Title = "修改";
    Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
    List<permModel> perm = null;
}
<style type="text/css">
    .Newformtable {
        margin-top: 4px;
    }

        .Newformtable th {
            width: 130px;
            height: 35px;
            font-weight: bold;
        }

        .Newformtable td {
            width: 180px;
        }

    input[type="text"] {
        width: 92%;
    }

    select {
        width: 98%;
    }

    textarea {
        width: 98%;
    }
</style>
<script type="text/javascript">
$(function () {
    $("#btnSave").click(function () {
        if ($("form").valid()) {
            $.ajax({
                url: "@Url.Action("Edit")",
                type: "Post",
                data: $("form").serialize(),
                dataType: "json",
                success: function (data) {
                    if (data.type == 1) {
                        window.parent.frameReturnByMes(data.message);
                        window.parent.frameReturnByReload(false);
                        window.parent.frameReturnByClose()
                    }
                    else {
                        window.parent.frameReturnByMes(data.message);
                    }
                }
            });
        }
        return false;
    });
    $("#btnReturn").click(function () {
         window.parent.frameReturnByClose();
    });
});
</script>
<div class="mvctool bgb">
@Html.ToolButton("btnSave", "fa fa-save", Resource.Save,ref perm, "Save", true)
@Html.ToolButton("btnReturn", "fa fa-reply", Resource.Reply,false)
</div>
@using (Html.BeginForm())
{
            @Html.HiddenFor(model => model.DEVICE_ID)
            @Html.HiddenFor(model => model.NODE_ID)
    @Html.HiddenFor(model => model.NET_STATUS)
    @Html.HiddenFor(model => model.NET_STATUS_TIME)
            <table class="Newformtable">
                <tbody>
                    <tr>
                        <th>
                            @Html.LabelFor(model => model.DEVICE_NAME, 0)：
                        </th>
                        <td>
                            @Html.EditorFor(model => model.DEVICE_NAME)
                        </td>
                        <th>
                            @Html.LabelFor(model => model.MODEL_ID, 0)：
                        </th>
                        <td>
                            @Html.DropDownListFor(model => model.MODEL_ID, ViewBag.DeviceModel as SelectList)
                        </td>
                    </tr>
                    <tr>
                        <th>
                            @Html.LabelFor(model => model.IP, 0)：
                        </th>
                        <td>
                            @Html.EditorFor(model => model.IP)
                        </td>
                        <th>
                            @Html.LabelFor(model => model.PORT, 0)：
                        </th>
                        <td>
                            @Html.EditorFor(model => model.PORT)
                        </td>
                    </tr>
                    <tr>
                        <th>
                            @Html.LabelFor(model => model.PARAMETERS, 0)：
                        </th>
                        <td colspan="3">
                            @Html.EditorFor(model => model.PARAMETERS)
                        </td>
                    </tr>
                </tbody>
            </table>
 @Html.ValidationSummary()
}

